package cn.edu.sdust.pojo;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Student {

    private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    private Integer id;
    private String stuId;
    private String name;
    private String sex;
    private Date birthday;
    private String phone;
    private String email;

    public Student() {

    }

    public Student(Integer id, String stuId, String name, String sex, Date birthday, String phone, String email) {
        this.id = id;
        this.stuId = stuId;
        this.name = name;
        this.sex = sex;
        this.birthday = birthday;
        this.phone = phone;
        this.email = email;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getStuId() {
        return stuId;
    }

    public void setStuId(String stuId) {
        this.stuId = stuId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public Date getBirthday() {
        return birthday;
    }

    //返回本地日期格式
    public String getLocalBirthday() {
        Date d = getBirthday();
        if (d != null) {
            return sdf.format(d);
        } else {
            return "";
        }
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Override
    public String toString() {
        return "Student{\"id\": " + getId() + ", \"stuId\": " + getStuId() + ", \"name\": " + getName() + ", \"sex\": " + getSex() +
                ", \"birthday\": " + getBirthday() + ", \"phone\": " + getPhone() + ", \"email\": " + getEmail() + "}";
    }
}
